package com.system.controller;

import com.system.pojo.PageBean;
import com.system.pojo.Result;
import com.system.pojo.complaininfo;
import com.system.service.ComplainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/complain")
public class ComplainController {
    @Autowired
    private ComplainService complainService;

    @GetMapping
    public Result<PageBean<complaininfo>> list(
            @RequestParam(required = false, defaultValue = "1") Integer pageNum,
            @RequestParam(required = false, defaultValue = "10") Integer pageSize,
            @RequestParam(required = false) Integer ownerId
    ) {
        PageBean<complaininfo> pb = complainService.list(pageNum, pageSize, ownerId);
        return Result.success(pb);
    }

    
}